<template>
    <van-nav-bar :title="route.meta.title" left-arrow @click-left="router.back()" fixed placeholder></van-nav-bar>
    <ArticleList class="list" :apifn="getPraiseList" :params="{ page: 1, limit: 10 }" />
    <van-back-top right="20px" bottom="60px" />
</template>

<script setup>
import { useRouter, useRoute } from 'vue-router';
import { getPraise } from '@/api/praise.js'
const router = useRouter()
const route = useRoute()

//进行格式处理，处理成组件需要的数据格式
const getPraiseList = async params => {
    let res = await getPraise(params)
    res.data.list = res.data.list?.map(item => {
        return {
            title: item.article.title,
            desc: item.article.desc,
            pic_url: item.article.picUrl,
            id: item.object_id,
        }
    })
    return res
}

</script>

<style lang="scss" scoped>
.list{
    padding: 0.26667rem 0.26667rem 0;
}


</style>